3.667 \(\int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^3 \, dx\)

Optimal. Leaf size=59 \[ \frac {a c^3 (B+i A) (1-i \tan (e+f x))^3}{3 f}-\frac {a B c^3 (1-i \tan (e+f x))^4}{4 f} \]

[Out]

1/3*a*(I*A+B)*c^3*(1-I*tan(f*x+e))^3/f-1/4*a*B*c^3*(1-I*tan(f*x+e))^4/f

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3588, 43} \[ \frac {a c^3 (B+i A) (1-i \tan (e+f x))^3}{3 f}-\frac {a B c^3 (1-i \tan (e+f x))^4}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^3,x]

[Out]

(a*(I*A + B)*c^3*(1 - I*Tan[e + f*x])^3)/(3*f) - (a*B*c^3*(1 - I*Tan[e + f*x])^4)/(4*f)

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^3 \, dx &=\frac {(a c) \operatorname {Subst}\left (\int (A+B x) (c-i c x)^2 \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left ((A-i B) (c-i c x)^2+\frac {i B (c-i c x)^3}{c}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a (i A+B) c^3 (1-i \tan (e+f x))^3}{3 f}-\frac {a B c^3 (1-i \tan (e+f x))^4}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 3.67, size = 161, normalized size = 2.73 \[ \frac {a c^3 \sec (e) \sec ^4(e+f x) (3 (B-i A) \cos (e+2 f x)+3 (B-2 i A) \cos (e)+5 A \sin (e+2 f x)-3 A \sin (3 e+2 f x)+2 A \sin (3 e+4 f x)-3 i A \cos (3 e+2 f x)-6 A \sin (e)+i B \sin (e+2 f x)-3 i B \sin (3 e+2 f x)+i B \sin (3 e+4 f x)+3 B \cos (3 e+2 f x)-3 i B \sin (e))}{12 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^3,x]

[Out]

(a*c^3*Sec[e]*Sec[e + f*x]^4*(3*((-2*I)*A + B)*Cos[e] + 3*((-I)*A + B)*Cos[e + 2*f*x] - (3*I)*A*Cos[3*e + 2*f*
x] + 3*B*Cos[3*e + 2*f*x] - 6*A*Sin[e] - (3*I)*B*Sin[e] + 5*A*Sin[e + 2*f*x] + I*B*Sin[e + 2*f*x] - 3*A*Sin[3*
e + 2*f*x] - (3*I)*B*Sin[3*e + 2*f*x] + 2*A*Sin[3*e + 4*f*x] + I*B*Sin[3*e + 4*f*x]))/(12*f)

________________________________________________________________________________________

fricas [A]  time = 1.00, size = 87, normalized size = 1.47 \[ \frac {{\left (8 i \, A + 8 \, B\right )} a c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (8 i \, A - 4 \, B\right )} a c^{3}}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/3*((8*I*A + 8*B)*a*c^3*e^(2*I*f*x + 2*I*e) + (8*I*A - 4*B)*a*c^3)/(f*e^(8*I*f*x + 8*I*e) + 4*f*e^(6*I*f*x +
6*I*e) + 6*f*e^(4*I*f*x + 4*I*e) + 4*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

giac [B]  time = 2.29, size = 106, normalized size = 1.80 \[ \frac {8 i \, A a c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 8 \, B a c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 8 i \, A a c^{3} - 4 \, B a c^{3}}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/3*(8*I*A*a*c^3*e^(2*I*f*x + 2*I*e) + 8*B*a*c^3*e^(2*I*f*x + 2*I*e) + 8*I*A*a*c^3 - 4*B*a*c^3)/(f*e^(8*I*f*x
+ 8*I*e) + 4*f*e^(6*I*f*x + 6*I*e) + 6*f*e^(4*I*f*x + 4*I*e) + 4*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 75, normalized size = 1.27 \[ \frac {a \,c^{3} \left (-\frac {2 i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {B \left (\tan ^{4}\left (f x +e \right )\right )}{4}-i A \left (\tan ^{2}\left (f x +e \right )\right )-\frac {A \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x)

[Out]

1/f*a*c^3*(-2/3*I*B*tan(f*x+e)^3-1/4*B*tan(f*x+e)^4-I*A*tan(f*x+e)^2-1/3*A*tan(f*x+e)^3+1/2*B*tan(f*x+e)^2+A*t
an(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.90, size = 73, normalized size = 1.24 \[ -\frac {3 \, B a c^{3} \tan \left (f x + e\right )^{4} + 4 \, {\left (A + 2 i \, B\right )} a c^{3} \tan \left (f x + e\right )^{3} + {\left (12 i \, A - 6 \, B\right )} a c^{3} \tan \left (f x + e\right )^{2} - 12 \, A a c^{3} \tan \left (f x + e\right )}{12 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

-1/12*(3*B*a*c^3*tan(f*x + e)^4 + 4*(A + 2*I*B)*a*c^3*tan(f*x + e)^3 + (12*I*A - 6*B)*a*c^3*tan(f*x + e)^2 - 1
2*A*a*c^3*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 8.47, size = 76, normalized size = 1.29 \[ -\frac {\frac {B\,a\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^4}{4}+\frac {a\,\left (A+B\,2{}\mathrm {i}\right )\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3}+\frac {a\,\left (-B+A\,2{}\mathrm {i}\right )\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2}-A\,a\,c^3\,\mathrm {tan}\left (e+f\,x\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i)^3,x)

[Out]

-((a*c^3*tan(e + f*x)^3*(A + B*2i))/3 - A*a*c^3*tan(e + f*x) + (B*a*c^3*tan(e + f*x)^4)/4 + (a*c^3*tan(e + f*x
)^2*(A*2i - B))/2)/f

________________________________________________________________________________________

sympy [B]  time = 0.57, size = 144, normalized size = 2.44 \[ \frac {- 8 A a c^{3} - 4 i B a c^{3} + \left (- 8 A a c^{3} e^{2 i e} + 8 i B a c^{3} e^{2 i e}\right ) e^{2 i f x}}{3 i f e^{8 i e} e^{8 i f x} + 12 i f e^{6 i e} e^{6 i f x} + 18 i f e^{4 i e} e^{4 i f x} + 12 i f e^{2 i e} e^{2 i f x} + 3 i f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**3,x)

[Out]

(-8*A*a*c**3 - 4*I*B*a*c**3 + (-8*A*a*c**3*exp(2*I*e) + 8*I*B*a*c**3*exp(2*I*e))*exp(2*I*f*x))/(3*I*f*exp(8*I*
e)*exp(8*I*f*x) + 12*I*f*exp(6*I*e)*exp(6*I*f*x) + 18*I*f*exp(4*I*e)*exp(4*I*f*x) + 12*I*f*exp(2*I*e)*exp(2*I*
f*x) + 3*I*f)

________________________________________________________________________________________